package r2118d1127;

import java.util.Objects;

public class Student {

    private double score;
    private String stuName;
    private String stuNum;
    public Student() {
    }

    public Student(double score, String stuName, String stuNum) {
        this.score = score;
        this.stuName = stuName;
        this.stuNum = stuNum;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public String getStuNum() {
        return stuNum;
    }

    public void setStuNum(String stuNum) {
        this.stuNum = stuNum;
    }

    @Override
    public String toString() {
        return "分数：" + score +"\t"+"姓名：" + stuName + "\t" + "学号：" + stuNum ;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return Double.compare(student.score, score) == 0 && Objects.equals(stuName, student.stuName) && Objects.equals(stuNum, student.stuNum);
    }

    @Override
    public int hashCode() {
        return Objects.hash(score, stuName, stuNum);
    }

}
